﻿@model IEnumerable<MvcCart.Models.Cart>

@{
    ViewData["Title"] = "Index";
}

<h1>Index</h1>

<p>
    <a asp-action="Create">Create New</a>
</p>
<form asp-controller="Cart" asp-action="Index" method="get">
<p>
商品id: <input type="text" name="searchString">
商品价格: <input type="text" name="low">-<input type="text" name="high">
<input type="submit" value="查询" />
</p>
</form>
<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.productid)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.productnum)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.price)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.userid)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.createtime)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
@foreach (var item in Model) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.productid)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.productnum)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.price)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.userid)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.createtime)
            </td>
            <td>
                <a asp-action="Edit" asp-route-id="@item.cartid">Edit</a> |
                <a asp-action="Details" asp-route-id="@item.cartid">Details</a> |
                <a asp-action="Delete" asp-route-id="@item.cartid">Delete</a>
            </td>
        </tr>
}
    </tbody>
</table>
